package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.BdmCloudInventory;
import com.ruoyi.system.domain.dto.BdmCloudInventoryDto;
import com.ruoyi.system.domain.vo.AgencyInventoryVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 云库存Mapper接口
 * 
 * @author ruoyi
 * @date 2024-12-24
 */
public interface BdmCloudInventoryMapper  extends BaseMapper<BdmCloudInventory>
{
    /**
     * 查询云库存
     * 
     * @param id 云库存主键
     * @return 云库存
     */
    public BdmCloudInventory selectBdmCloudInventoryById(Long id);

    /**
     * 查询云库存列表
     * 
     * @param bdmCloudInventory 云库存
     * @return 云库存集合
     */
    public List<BdmCloudInventory> selectBdmCloudInventoryList(BdmCloudInventory bdmCloudInventory);

    /**
     * 新增云库存
     * 
     * @param bdmCloudInventory 云库存
     * @return 结果
     */
    public int insertBdmCloudInventory(BdmCloudInventory bdmCloudInventory);

    /**
     * 修改云库存
     * 
     * @param bdmCloudInventory 云库存
     * @return 结果
     */
    public int updateBdmCloudInventory(BdmCloudInventory bdmCloudInventory);

    /**
     * 删除云库存
     * 
     * @param id 云库存主键
     * @return 结果
     */
    public int deleteBdmCloudInventoryById(Long id);

    /**
     * 批量删除云库存
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBdmCloudInventoryByIds(Long[] ids);


    int reduceInventory(@Param("userId") Long userId, @Param("goodId") Long goodId,@Param("num") long num);


    List<AgencyInventoryVo> listAgencyInventory(@Param("bdmCloudInventoryDto") BdmCloudInventoryDto bdmCloudInventoryDto);

    List<AgencyInventoryVo> listAgencyInventoryByUserId(BdmCloudInventoryDto dto);


    List<BdmCloudInventory> listAgencyInventoryById(@Param("userId") Long userId);


    List<BdmCloudInventory> appletListAgencyInventoryById(@Param("userId") Long userId);

    /**
     * 查询库存扣减类型
     */
    List<String> getInventoryDeductionType();

}
